<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<ui:composition template="/paginas/template/template.xhtml">
	<ui:define name="body">
		<h:form>


			<p:panelGrid columns="2">

				<h:outputLabel for="codigoEvento" value="Codigo" />
				
				<p:inputText id="codigoEvento"
					value="#{configuracaoControl.eventoFiltro.codigo}" label="Codigo" />

				<h:outputLabel for="descricaoEvento" value="Descrição" />

				<p:inputText id="descricaoEvento"
					value="#{configuracaoControl.eventoFiltro.descricao}" label="Descrição" />

				<p:commandButton value="Pesquisar" ajax="false"
					action="#{configuracaoControl.pesquisarEvento()}"  />
					
				<p:commandButton value="Novo" ajax="false" immediate="true"
					action="/paginas/configuracao/evento/eventoFormulario.xhtml" />

			</p:panelGrid>


			<p:dataTable value="#{configuracaoControl.listEvento}" var="item" 
				selection="#{configuracaoControl.evento}" id="tabelaEvento"
				selectionMode="single" >
				
				<p:column >
					<f:facet name="header">
						<h:outputText value="Codigo" />
					</f:facet>
					<h:outputText value="#{item.codigo}" />
				</p:column>
				<p:column>
					<f:facet name="header">
						<h:outputText value="Descrição" />
					</f:facet>
					<h:outputText value="#{item.descricao}" />
				</p:column>
				
				<p:column>
					<f:facet name="header">
						<h:outputText value="Local" />
					</f:facet>
					<h:outputText value="#{item.local}" />
				</p:column>
				
				<p:column>
					<f:facet name="header">
						<h:outputText value="Inicio" />
					</f:facet>
					<h:outputText value="#{item.dataInicio}" />
				</p:column>
				
				<p:column>
					<f:facet name="header">
						<h:outputText value="Fim" />
					</f:facet>
					<h:outputText value="#{item.dataFim}" />
				</p:column>
				
				<f:facet name="footer">
					<p:commandButton id="viewButton" value="Ver" icon="ui-icon-search"
						action="/paginas/configuracao/evento/eventoFormulario.xhtml" ajax="false" />
						<p:commandButton id="removerButton" value="Remover" icon="ui-icon-search"
						action="#{configuracaoControl.deletaEvento()}" ajax="false" />
				</f:facet>
			</p:dataTable>

		</h:form>
	</ui:define>
	

</ui:composition>
</html>